package com.health.department.service.impl;

import java.util.List;
import com.health.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.health.department.mapper.MedicalDepartmentMapper;
import com.health.department.domain.MedicalDepartment;
import com.health.department.service.IMedicalDepartmentService;

/**
 * 科室管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-26
 */
@Service
public class MedicalDepartmentServiceImpl implements IMedicalDepartmentService 
{
    @Autowired
    private MedicalDepartmentMapper medicalDepartmentMapper;

    /**
     * 查询科室管理
     * 
     * @param departmentId 科室管理主键
     * @return 科室管理
     */
    @Override
    public MedicalDepartment selectMedicalDepartmentByDepartmentId(Long departmentId)
    {
        return medicalDepartmentMapper.selectMedicalDepartmentByDepartmentId(departmentId);
    }

    /**
     * 查询科室管理列表
     * 
     * @param medicalDepartment 科室管理
     * @return 科室管理
     */
    @Override
    public List<MedicalDepartment> selectMedicalDepartmentList(MedicalDepartment medicalDepartment)
    {
        return medicalDepartmentMapper.selectMedicalDepartmentList(medicalDepartment);
    }

    /**
     * 新增科室管理
     * 
     * @param medicalDepartment 科室管理
     * @return 结果
     */
    @Override
    public int insertMedicalDepartment(MedicalDepartment medicalDepartment)
    {
        medicalDepartment.setCreateTime(DateUtils.getNowDate());
        return medicalDepartmentMapper.insertMedicalDepartment(medicalDepartment);
    }

    /**
     * 修改科室管理
     * 
     * @param medicalDepartment 科室管理
     * @return 结果
     */
    @Override
    public int updateMedicalDepartment(MedicalDepartment medicalDepartment)
    {
        medicalDepartment.setUpdateTime(DateUtils.getNowDate());
        return medicalDepartmentMapper.updateMedicalDepartment(medicalDepartment);
    }

    /**
     * 批量删除科室管理
     * 
     * @param departmentIds 需要删除的科室管理主键
     * @return 结果
     */
    @Override
    public int deleteMedicalDepartmentByDepartmentIds(Long[] departmentIds)
    {
        return medicalDepartmentMapper.deleteMedicalDepartmentByDepartmentIds(departmentIds);
    }

    /**
     * 删除科室管理信息
     * 
     * @param departmentId 科室管理主键
     * @return 结果
     */
    @Override
    public int deleteMedicalDepartmentByDepartmentId(Long departmentId)
    {
        return medicalDepartmentMapper.deleteMedicalDepartmentByDepartmentId(departmentId);
    }
}
